//
//  ExamCourseTableViewCell.h
//  CommunityNannyO2O
//
//  Created by apple on 15/8/13.
//  Copyright (c) 2015年 Apple. All rights reserved.
//

#import "ExamCourseTableViewCell.h"
#import "APIAdress.h"
#import "MBProgressHUD+YC.h"
#import "MJExtension.h"
#import "AccountTool.h"
#import "UIViewController+Create.h"
#import "CustomTextField.h"
#import "AppConfig.h"
#import "ExamCourseTableViewCell.h"
#import "QXNetWorkTool.h"
#import "UserDataSingleton.h"

@interface ExamCourseTableViewCell()<QXNetWorkToolDelegate>

@end

@implementation ExamCourseTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"ExamCourseTableViewCell";
    ExamCourseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        
        cell = [[[NSBundle mainBundle] loadNibNamed:ID owner:nil options:nil]firstObject];
        
        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    }
    
    return cell;
}

- (void)awakeFromNib
{
    UIView *view = [self viewWithTag:1];
    view.backgroundColor = [UIColor clearColor];

    UIView *subView0 = [view viewWithTag:11];
    UIView *subView1 = [view viewWithTag:12];
    UIView *subView2 = [view viewWithTag:13];
    UIView *subView3 = [view viewWithTag:14];
    
    subView0.backgroundColor = [UIColor clearColor];
    subView1.backgroundColor = [UIColor clearColor];
    subView2.backgroundColor = [UIColor clearColor];
    subView3.backgroundColor = [UIColor clearColor];
    
    
    //手势
    //0
    UITapGestureRecognizer *tapGestureRecognizer0 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    
    [subView0 addGestureRecognizer:tapGestureRecognizer0];
    
    //1
    UITapGestureRecognizer *tapGestureRecognizer1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    
    [subView1 addGestureRecognizer:tapGestureRecognizer1];
    
    //2
    UITapGestureRecognizer *tapGestureRecognizer2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    
    [subView2 addGestureRecognizer:tapGestureRecognizer2];
    
    //3
    UITapGestureRecognizer *tapGestureRecognizer3 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    
    [subView3 addGestureRecognizer:tapGestureRecognizer3];
}

-(void)tap:(UITapGestureRecognizer *)recognizer
{
    NSString *str;
    NSString *major_id;
    if (recognizer.view.tag == 11)
    {
        str = @"电吉他";
        major_id = [UserDataSingleton shareInstance].quiTa;
    }
    else if (recognizer.view.tag == 12)
    {
        str = @"爵士鼓";
        major_id = [UserDataSingleton shareInstance].JazzDrum;
    }
    else if (recognizer.view.tag == 13)
    {
        str = @"电贝斯";
        major_id = [UserDataSingleton shareInstance].bass;
    }
    else if (recognizer.view.tag == 14)
    {
        str = @"音乐理论";
        major_id = [UserDataSingleton shareInstance].musicBase;
    }
    
    if ([self.selectExamCourseTableCellDelegate respondsToSelector:@selector(setCourse:majorId:)]) {
        
        [self.selectExamCourseTableCellDelegate setCourse:str majorId:major_id];
    }
}

@end




















